var res []string
var hashmap []string = []string{
    "",
    "",
    "abc",
    "def",
    "ghi",
    "jkl",
    "mno",
    "pqrs",
    "tuv",
    "wxyz",
}

func letterCombinations(digits string) []string {
    res = make([]string, 0)
    if len(digits) <= 0 || len(digits) > 4 {
        return res
    }
    backtracking(digits, 0, "")
    return res
}

func backtracking(digits string, index int, pathstring string){
    if len(pathstring) == len(digits) {
        res = append(res, pathstring)
        return
    }
    currentIndexNum := digits[index] - '0' // 转成数字
    letter := hashmap[currentIndexNum]     // 拿到内容
    for i:=0; i<len(letter); i++ {
        pathstring = pathstring + string(letter[i])
        backtracking(digits, index+1, pathstring)
        pathstring = pathstring[:len(pathstring)-1]
    }
}